/////////////////////////////////////////////////////////////////////////////
// Filename: Draw_triangle.cpp
// Description: Draw triangles using OpenGL
/////////////////////////////////////////////////////////////////////////////

#include "Draw_triangle.h"
#include <GL/glut.h>


void empty_triangle(Vector3 const &v1, Vector3 const &v2, Vector3 const &v3, Color const &col){
	
	glColor3f(col.r,col.g,col.b);

	glBegin(GL_LINE_STRIP);
		glVertex3f(v1.x,v1.y,v1.z);
		glVertex3f(v2.x,v2.y,v2.z);
		glVertex3f(v3.x,v3.y,v3.z);
		glVertex3f(v1.x,v1.y,v1.z);
	glEnd();
}

void solid_triangle(Vector3 const &v1, Vector3 const &v2, Vector3 const &v3, Color const &col){
	glColor3f(col.r,col.g,col.b);
	glBegin(GL_TRIANGLES);
		glVertex3f(v1.x,v1.y,v1.z);
		glVertex3f(v2.x,v2.y,v2.z);
		glVertex3f(v3.x,v3.y,v3.z);
	glEnd();
}

void interp_triangle(Vector3 const &v1, Vector3 const &v2, Vector3 const &v3,
					 Color const &col1, Color const &col2, Color const &col3){
						 
	glBegin(GL_TRIANGLES);
		glColor3f(col1.r,col1.g,col1.b);
		glVertex3f(v1.x,v1.y,v1.z);
		glColor3f(col2.r,col2.g,col2.b);
		glVertex3f(v2.x,v2.y,v2.z);
		glColor3f(col3.r,col3.g,col3.b);
		glVertex3f(v3.x,v3.y,v3.z);
	glEnd();
}


/////////////////////////////////////////////////////////////////////////////
//                               END OF FILE                               //
/////////////////////////////////////////////////////////////////////////////
